package com.tz.cartelo.model;



import com.tz.cartelo.constant.Api;

import java.util.HashMap;
import java.util.Map;

/**
 * Data parameters for HTTP request.
 * Created by Chris on 16/7/18.
 */
public class DataParams {

    private Api api;
    // Whether to show loading dialog.
    private boolean showLoading;
    private Map<String, String> params = new HashMap<>();

    public DataParams(Api api, boolean showLoading) {
        this.api = api;
        this.showLoading = showLoading;
    }

    public Map<String, String> getParams() {
        return params;
    }

    public void setParams(Map<String, String> params) {
        this.params = params;
    }

    public void addParam(String key, String value) {
        params.put(key, value);
    }

    public void addParams(Map<String, String> params) {
        this.params.putAll(params);
    }

    public Api getApi() {
        return api;
    }

    public boolean isShowLoading() {
        return showLoading;
    }

    public String getRequestUrl() {
        return api.getUrl();
    }

}
